package com.it235.seata.storage.mapper;

import com.it235.seata.storage.entry.Storage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * 功能描述:
 *
 * @author: 李明杰
 * @date: 2022/1/18 0:23
 */
@Repository
public interface StorageMapper extends Mapper<Storage> {
    @Update("update tab_storage set total =total-#{currentUsed},used=used+#{currentUsed} where product_id=#{productId}")
    int updateUsed(@Param("productId") long productId, @Param("currentUsed") long currentUsed);
}
